package com.leyou.common.holder;

import com.leyou.common.auth.pojo.UserInfo;

/**
 * @author 虎哥
 */
public class UserHolder {

    private static final ThreadLocal<UserInfo> tl = new ThreadLocal<>();

    public static UserInfo getUserInfo() {
        return tl.get();
    }

    public static void setUserInfo(UserInfo userInfo) {
        tl.set(userInfo);
    }

    public static void removeUser(){
        tl.remove();
    }
}
